package com.example.widgetcase;

import com.example.widget_lib.utils.PxUtil;

import org.junit.Assert;

import org.junit.Test;

public class ExampleOhosTest {
    /**
     * onStart
     */
    @Test
    public void onStart() {
        testFormatNum1();
        testFormatNum2();
    }

    /**
     * testFormatNum1
     */
    @Test
    public void testFormatNum1() {
        int num = 10;
        String result = PxUtil.formatNum(num);
        Assert.assertNotNull(result);
        Assert.assertEquals("10.0", result);
    }

    /**
     * testFormatNum2
     */
    @Test
    public void testFormatNum2() {
        float num = 10.543f;
        String result = PxUtil.formatNum(num);
        Assert.assertNotNull(result);
        Assert.assertEquals("10.54", result);
    }
}